<?php
    if(count($this->location) > 0) :
        foreach($this->location as $value) :
            if(!empty($this->location_id) && ($this->location_id == $value['id'])) :
?>
    <option selected="selected" value="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></option>
<?php else : ?>
    <option value="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></option>
<?php
            endif;
        endforeach;
    endif;
?>